#ifndef __CUSTOM_CHARACTER_CONTROLLER_H__
#define __CUSTOM_CHARACTER_CONTROLLER_H__

#include "CharacterController.h"


/////////////////////////////////////////////////////////////////////////////////////
//  SONIC 
/////////////////////////////////////////////////////////////////////////////////////

class SonicController : public BasicCharacterController
{
public :
	SonicController(  b2Body * _body ) : BasicCharacterController(_body){};
	virtual ~SonicController(){};
	//virtual void update(ccTime dt);
};


/////////////////////////////////////////////////////////////////////////////////////
//  MARIO 
/////////////////////////////////////////////////////////////////////////////////////

class MarioController : public BasicCharacterController
{
protected:

	float GravityInWall;
	float JumpWallVelocityX;
	float JumpWallVelocityY;
	float MaxSpeedYOnWall;

public :
	MarioController(  b2Body * _body ) : BasicCharacterController(_body),
										GravityInWall(  0.021875f ),
										JumpWallVelocityX( JumpVelocity ),
										JumpWallVelocityY( JumpVelocity )
	{
		AirAcc = XForce;
		JumpWallVelocityX = JumpVelocity * 1.3f;

		MaxSpeedYOnWall = 3.0f;
	};

	virtual ~MarioController(){};
	virtual void update(ccTime dt);
};

/////////////////////////////////////////////////////////////////////////////////////
//  MEAT BOY 
/////////////////////////////////////////////////////////////////////////////////////

class MeatBoyController : public MarioController
{
protected:

	float AccXSolSpeedOff;
	float AccXAirSpeedOff;
	float MaxSpeedSpeedOff;

	float AccXSolSpeedOn;
	float AccXAirSpeedOn;
	float MaxSpeedSpeedOn;

	bool IsSpeedOn;

public :
	MeatBoyController(  b2Body * _body ) : MarioController(_body)							
	{
		// redifinition variables

		XForce = AirAcc = 0.1f;

		JumpVelocity = 10.5f;
		MinJumpVelocity = 4.0f;


		maxXVelocity = 9.0f;
		InvertXForce =  0.5f;
		
		GravityInWall = 0.017875f;
		JumpWallVelocityX = JumpVelocity * 0.8f;
		JumpWallVelocityY = JumpVelocity;



		// special Meat Boy
		IsSpeedOn = false;

		AccXSolSpeedOff = XForce;
		AccXAirSpeedOff = AirAcc;
		MaxSpeedSpeedOff = maxXVelocity;

		AccXSolSpeedOn = AccXSolSpeedOff * 2.0f;
		AccXAirSpeedOn = AccXAirSpeedOff * 2.0f;
		MaxSpeedSpeedOn = MaxSpeedSpeedOff * 2.0f;
	};

	virtual ~MeatBoyController(){};
	virtual void update(ccTime dt);
	virtual void draw(CCPoint Offset);
};


#endif